#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QProcess>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    testPerl( "/Users/jillianaurisano/Development/bio-sage/perlScripts/hello_world.pl" );

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::testPerl(QString pathToScript)
{
    qDebug() << pathToScript << endl;

    QProcess perl;
    QString command = "perl ";
    perl.start( "perl /Users/jillianaurisano/Development/bio-sage/perlScripts/hello_world.pl" );//comand.append( pathToScript.toStdString() ) )

    perl.waitForFinished(-1);

    QString p_stdout = perl.readAllStandardOutput();
    QString p_stderr = perl.readAllStandardError();

    qDebug()  << p_stdout;

    return 0;
}
